Release 10.1A: OpenEdge Development:
Programming Interfaces
Marshalling and unmarshalling data for socket I/O
After reading data from a socket into a
MEMPTRvariable, any 4GL procedure that needs to interpret the data must unmarshall the data from theMEMPTRmemory region. Unmarshalling the data converts it from bytes in memory to the 4GL data types that the 4GL procedure can use, as determined by your application and the byte order of theMEMPTRdata.Similarly, before writing data to a socket from a
MEMPTRvariable, a 4GL procedure must marshall data into theMEMPTRmemory region. Marshalling the data converts it from the 4GL data types the procedure understands to bytes in memory that can be written to the socket. Again, how you organize the bytes in theMEMPTRmemory region depends on your application and the application with which you are communicating.The 4GL supports several statements and functions for marshalling and unmarshalling data in different forms. All such statements and functions that interact directly with
MEMPTRvariables convert between bytes and 4GL data types according to theMEMPTRbyte order that you specify. Before using aMEMPTRvariable to read or write socket data, both the socket client and socket server must set their respectiveMEMPTRvariables to an identical byte order. When marshalling and unmarshalling the data, you must make certain to accessMEMPTRdata in conformance with the agreed and specifiedMEMPTRbyte order.For more information on byte order and the statements and functions for marshalling and unmarshalling
MEMPTRdata, see Chapter 8, " Introduction to External Program Interfaces."
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |